package com.imooc.service.impl;

import com.github.pagehelper.PageInfo;
import com.imooc.utils.PagedGridResult;
import java.util.List;

/**
 * @ClassName: BaseService
 * @Package: com.imooc.service.impl.center
 * @Description:
 * @Date: 2021/7/26 14:37
 * @Author: sunzheng@beiming.com
 */
public class BaseService {

  public PagedGridResult setPageGrid(List<?> list, Integer page) {
    PageInfo<?> pageList = new PageInfo<>(list);
    PagedGridResult grid = new PagedGridResult();
    grid.setPage(page);
    grid.setRows(list);
    grid.setTotal(pageList.getPages());
    grid.setRecords(pageList.getTotal());
    return grid;
  }

}
